-
Notifications
You must be signed in to change notification settings - Fork 8
Enable commit-specific git fetch for compatibility with external forks. #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
8c661f1 to
ff48771
Compare
Signed-off-by: Leander Stephen D'Souza <leanderdsouza1234@gmail.com>
85222a3 to
e4d26d4
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
- Coverage 26.98% 26.86% -0.13%
==========================================
Files 31 31
Lines 2238 2248 +10
Branches 392 396 +4
==========================================
Hits 604 604
- Misses 1574 1584 +10
Partials 60 60 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This pull request adds support for fetching specific commit hashes in non-shallow Git import mode, and improves test skipping for VCS tools that may not be installed.
- Refactored version type determination to work for both shallow and non-shallow modes
- Added explicit fetch of commit hashes for non-shallow repository imports
- Added test skipping when SVN or Mercurial tools are not available
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| vcs2l/clients/git.py | Refactored to determine version type earlier and fetch specific commit hashes in non-shallow mode for both existing and new repositories |
| test/test_commands.py | Added utility variables and skip decorator for tests requiring SVN and Mercurial |
| test/reimport_force.txt | Updated expected output to include fetch messages for commit hash imports |
| test/import.txt | Updated expected output to include fetch messages for commit hash imports |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The checks added here are part of the fixture setup in __init__.py. What's the motivation to duplicate them here?
Basic Info
Description of contribution in a few bullet points
svninwindows-2025.Description of how this change was tested
1. Testing against vcs2l old pull requests
First, clone the codebase:
Next, use the following
repos.yamlto get the commit hash of the following external fork:Finally, update the existing repository:
This will successfully checkout the repository to the specific hash.
This step fails without this contribution with the following error message:
=== ./vcs2l-ext-fork (git) === Could not checkout ref '4ad2dd14b0033c275e5faff7935c4a7d7581fee4': fatal: reference is not a tree: 4ad2dd14b0033c275e5faff7935c4a7d7581fee42. Test against the reproduction step in the parent issue - dirk-thomas/vcstool#258
Reproduction measures specified by @timor-raiman